﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace NDK.Frm
{
    public partial class Dlg_Notice : Form
    {
        public Dlg_Notice()
        {
            InitializeComponent();
        }

        private void Dlg_Notice_Load(object sender, EventArgs e)
        {
            lbl_NoticeTxt.Text = "参数修改中...";
            bar_step.Maximum = 100;
        }

        public void UpdateStep(int percentValue, string stepMsg, bool succeed)
        {
            try
            {
                bar_step.Value = percentValue;

                if (succeed == true)
                {
                    lbl_step.ForeColor = Color.GreenYellow;
                }
                else
                {
                    lbl_step.ForeColor = Color.Red;
                    if (string.IsNullOrEmpty(lbl_Failstep.Text))
                        lbl_Failstep.Text += stepMsg;
                    else
                    { 
                        lbl_Failstep.Text += Environment.NewLine;
                        lbl_Failstep.Text += stepMsg;
                    }
                }
                Application.DoEvents();
            }
            catch (Exception ex)
            {
            }
        }
    }
}
